<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
    <title>复制问卷</title>
    <link rel="stylesheet" type="text/css" href="${s.base}/lib/layui/css/layui.css"/>
    <link rel="stylesheet" type="text/css" href="${s.base}/css/base/index.css"/>
    <link rel="stylesheet" type="text/css" href="${s.base}/css/base/theme/theme.css"/>
    <style>
        .w440 {
            width: 440px !important;
        }
    </style>
</head>
<body>
<div class="page-content-wrap clearfix">
    <form class="layui-form" id="tool">
        <input type="hidden" name="applyId" value="${applyId}" />
        <div class="layui-tab">
            <div class="layui-tab-content">
                <div class="layui-tab-item layui-show">
                    <div class="layui-form-item">
                        <label class="layui-form-label"><span class="red">*</span>&nbsp;问卷标题：</label>
                        <div class="layui-input-inline w440">
                            <input type="text" name="title" value="${question.title}" lay-verify="required" placeholder="请输入问卷标题" autocomplete="off" class="layui-input" maxlength="200">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label"><span class="red">*</span>&nbsp;开始时间：</label>
                        <div class="layui-input-inline w440">
                            <input type="text" name="startTimeStr" lay-verify="required" id="startTime" lay-verify="date" value="<#if question.startTime??>${question.startTime?string('yyyy-MM-dd')}</#if>"
                                   placeholder="yyyy-MM-dd" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label"><span class="red">*</span>&nbsp;结束时间：</label>
                        <div class="layui-input-inline w440">
                            <input type="text" name="endTimeStr" lay-verify="required" id="endTime" lay-verify="date" value="<#if question.endTime??>${question.endTime?string('yyyy-MM-dd')}</#if>"
                                   placeholder="yyyy-MM-dd" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">&nbsp;描述：</label>
                        <div class="layui-input-inline w440">
                            <textarea style="border:#e6e6e6 1px solid !important;padding-left: 10px !important;" class="layui-textarea" name="remark"
                                      autocomplete="off" placeholder="请输入描述" maxlength="2000">${question.remark}</textarea>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block" style="margin-left: 0px !important;text-align: center">
                <button class="layui-btn layui-btn-normal" lay-submit lay-filter="saveBtn">保存</button>
                <button type="button" id="cancel" class="layui-btn layui-btn-primary">取消</button>
                <button type="button" style="display: none;" id="save" class="layui-btn layui-btn-primary"></button>
            </div>
        </div>
    </form>
</div>
<script src="${s.base}/lib/layui/layui.js" type="text/javascript" charset="utf-8"></script>
<script src="${s.base}/js/common.js" type="text/javascript" charset="utf-8"></script>
<script>
    layui.use(['jquery', 'form', 'page', 'dialog', 'fileUtil', 'baseutil','laydate'], function () {
        var $ = layui.jquery,
            form = layui.form,
            page = layui.page,
            dialog = layui.dialog,
            laydate = layui.laydate,
            fileUtil = layui.fileUtil,
            baseutil = layui.baseutil;

        laydate.render({
            elem: '#startTime', //指定元素
            type: 'date',trigger: 'click'
        });
        laydate.render({
            elem: '#endTime', //指定元素
            type: 'date',trigger: 'click'
        });

        //监听保存
        form.on('submit(saveBtn)', function (data) {
            data.field.id = '${question.id}';
            baseutil.AjaxPostMark("/work/question/copy", data.field, function () {
                $("#save").click();
            });
            return false;
        });
    });
</script>
</body>
</html>